home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / ROTR.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  321 b   |  13 lines

  1.  /* rotr.c from page 228*/
  2.  #include <stdio.h>
  3.  #include <stdlib.h>
  4.  main()
  5.  {
  6.     int bits;
  7.     unsigned value;
  8. printf("Enter a hexadecimal value to be rotated :");
  9. scanf( "%4x", &value);
  10. for (bits = 1; bits < 17; bits++)
  11.     printf("%4.4x rotated right by %d bits = %#4.4x \n",
  12.     value, bits, _rotr(value, bits));
  13.  }